home *** CD-ROM | disk | FTP | other *** search
- Path: news.uunet.ca!onlsys!ken.sheffield
- From: ken.sheffield@onlinesys.com (KEN SHEFFIELD)
- Newsgroups: comp.lang.c
- Subject: RE: WHY WON'T THIS COMPIL
- Message-ID: <8BB14D1.07940016F2.uuout@onlinesys.com>
- Date: Mon, 19 Feb 96 20:33:00 -500
- Distribution: world
- Organization: Online Systems Of Canada
- Reply-To: ken.sheffield@onlinesys.com (KEN SHEFFIELD)
- References: <4g50et$9lh@steel.interlog.com>
- X-Newsreader: PCBoard Version 15.22
- X-Mailer: PCBoard/UUOUT Version 1.20
-
- TOPIC: Re: Why won't this compil
-
- KK> Hi. Can someone please explain why this program won't
- KK> compile without errors? I am using Power C under DOS.
-
-
- KK> Heres the ANSI-C code:
-
- KK> #include <stdio.h>
- KK> #include <stdlib.h>
-
- KK> void swap(int *, int *);
-
- KK> main()
- KK> {
- KK> int var1, var2;
-
- KK> var1 = 25;
- KK> var2 = 99;
- KK> printf("Variables before swap");
- KK> printf("var1 = %d , var2 = %d\n",var1,var2);
-
- KK> swap(&var1, &var2);
- KK> printf("Variables after swap");
- KK> printf("var1 = %d , var2 = %d\n,var1,var2);
- KK> } ^"^forgot a quote.
-
- KK> void swap(int *ptr1,int *ptr2)
- KK> {
- KK> int temp;
- KK> temp = *ptr1;
- KK> *ptr1 = *ptr2;
- KK> *ptr2 = temp;
- KK> }
-
- KK> -----------------------------
- KK> And, heres the C.ERR file:
-
- KK> pointc~1.txt(18):}
- KK> **************** ^202
- KK> 202: String constant cannot span lines
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(20):void swap(int *ptr1,int *ptr2)
- KK> **************** ^ 4, 14 ^ 6 ^104,222, 6,104,222
- KK> 4: ')' expected
- KK> 14: ';' expected
- KK> 6: Illegal symbol
- KK> 104: Undeclared identifier
- KK> 222: Warning - Pointer does not match scalar (int, long, etc)
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(21):{
- KK> **************** ^ 14
- KK> 14: ';' expected
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(23): temp = *ptr1;
- KK> **************** ^104,141
- KK> 104: Undeclared identifier
- KK> 141: Type of variable is not pointer
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(24): *ptr1 = *ptr2;
- KK> **************** ^104,141,104,141
- KK> 104: Undeclared identifier
- KK> 141: Type of variable is not pointer
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(25): *ptr2 = temp;
- KK> **************** ^104,141
- KK> 104: Undeclared identifier
- KK> 141: Type of variable is not pointer
- KK> ------------------------------------------------------------
- KK> pointc~1.txt(26):}
- KK> **************** ^ 9
- KK> 9: Right braces expected
- KK> ------------------------------------------------------------
-
-
- KK> Any help will be appericated. Please email respones directly to
- KK> me. Thank's.
-
-
-
- KK> KING KAOS
-
- KEN SHEFFIELD
-
- ... Hello? #TF# Are you there? Earth to #TF@ ? Hello?
- * Evaluation copy of Silver Xpress. Day # 89
- * Silver Xpress V4.3
-